refactor!: remove deprecated divisionPolicy config and averageDeci#5
Merged
Conversation
… ABI validation (0.3.0) Breaking changes: - Remove DeciConfiguration.divisionPolicy, resetDivisionPolicy(), and the DeciDivisionPolicy class. The `/` and `%` operators now always divide using DeciContext.DEFAULT (20 fractional digits, HALF_UP) — identical to the previous out-of-the-box default. Use divide(other, context) or divide(other, scale, roundingMode) for explicit control. - Remove Iterable<Deci>.averageDeci(); use Iterable<Deci>.mean() from org.kimplify.deci.statistics instead (drop-in replacement). Build/tooling: - Migrate from the deprecated standalone binary-compatibility-validator plugin to the Kotlin Gradle plugin's built-in abiValidation DSL. apiDump/apiCheck are replaced by updateKotlinAbi/checkKotlinAbi; the reference dump now lives at deci/api/jvm/deci.api (JVM) and deci/api/deci.klib.api (Native, JS, Wasm). - Drop binary-compatibility-validator / bcv-gradle-plugin version-catalog entries and bump version to 0.3.0. Rename DeciDivisionPolicy.kt to DeciConfiguration.kt and update CHANGELOG, README, CLAUDE.md, and CI accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merkost
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the deprecated division-policy configuration and the deprecated
averageDeciextension from the publicAPI. This is a breaking removal, so the library is bumped to 0.3.0.
DeciConfiguration.divisionPolicy,DeciConfiguration.resetDivisionPolicy(), and theDeciDivisionPolicyclass. The/operator no longer reads a global mutable policy — it now always divideswith
DeciContext.DEFAULT(20 fractional digits,HALF_UP), which is identical to the previous out-of-the-boxdefault.
%(computed via/) is unaffected.Iterable<Deci>.averageDeci().Iterable<Deci>.mean()(fromorg.kimplify.deci.statistics) is adrop-in replacement with the same signature and semantics.
config/DeciDivisionPolicy.kt→config/DeciConfiguration.kt(its namesake type is gone).DeciConfiguration.logSink/disableLogging()are untouched.deci/api/jvm/deci.api,deci/api/deci.klib.api) and updated KDoc + README to theper-call
divide(other, context)idiom.Runtime behavior is unchanged for any code that never reassigned the global
divisionPolicy.Changelog
Changed
/and%operators are now fixed toDeciContext.DEFAULT. Behaviour is unchanged for any code thatnever reassigned the (now-removed) global
divisionPolicy: bare division still yields 20 fractional digitswith
HALF_UProunding, and%(which is computed via/) is likewise unaffected.Removed
DeciConfiguration.divisionPolicy,DeciConfiguration.resetDivisionPolicy(), and theDeciDivisionPolicyclass. The/operator no longer readsa global mutable policy; it always divides with
DeciContext.DEFAULT(20 fractional digits,HALF_UP) —identical to the previous out-of-the-box default. To customise division scale or rounding, pass an explicit
context per call:
a.divide(b, DeciContext.CURRENCY_USD)ora.divide(b, scale = 4, roundingMode = RoundingMode.HALF_EVEN).DeciConfiguration.logSink/disableLogging()are unaffected.Iterable<Deci>.averageDeci()removed (breaking). UseIterable<Deci>.mean()fromorg.kimplify.deci.statisticsinstead — a drop-in replacement with the same signature and semantics:values.mean(context).Test Plan
./gradlew allTests) — JVM, JS, WasmJs, iosSimulatorArm64, macosArm64 all green./gradlew ktlintCheck)./gradlew checkKotlinAbi) — ABI dumps regenerated; removed symbols absentfrom both JVM and klib dumps
./gradlew :sample:composeApp:compileKotlinJvm)